<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>本科生毕业设计选导师系统</title>
    <link rel="stylesheet" href="../static/layui/css/layui.css">
</head>
<body>
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo layui-hide-xs layui-bg-black">本科生毕业设计选导师系统</div>
        <!-- 头部区域（可配合layui 已有的水平导航） -->
        <ul class="layui-nav layui-layout-left">
            <!-- 移动端显示 -->
            <li class="layui-nav-item layui-show-xs-inline-block layui-hide-sm" lay-header-event="menuLeft">
                <i class="layui-icon layui-icon-spread-left"></i>
            </li>
        </ul>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item layui-hide layui-show-md-inline-block">
                <a th:text="${username}">
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="/static/backstage/back-info.html" target="iframeMain">设置</a></dd>
                    <dd><a href="/">退出</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item" lay-header-event="menuRight" lay-unselect>
                <a>
                    <i class="layui-icon layui-icon-more-vertical"></i>
                </a>
            </li>
        </ul>
    </div>
    <div style="padding: 15px;" id="news" hidden="hidden" >
        <div class="layui-collapse newscontext ">

        </div>
    </div>
    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree" lay-filter="test">
                <li class="layui-nav-item layui-nav-itemed">
                    <a class="">个人资料</a>
                    <dl class="layui-nav-child">
                        <dd><a href="/static/backstage/back-info.html" target="iframeMain">确定学生</a></dd>
                    </dl>
                </li>
            </ul>
        </div>
    </div>

    <div class="layui-body">
        <!-- 内容主体区域 -->
        <iframe name="iframeMain" src="/static/back/ts.html" style="width: 100%;height: 100%"></iframe>
    </div>

    <div class="layui-footer">
        <!-- 底部固定区域 -->

    </div>
</div>
<script src="../static/layui/layui.js"></script>
<script src="../static/js/jquery.min.js"></script>
<script src="../static/js/baseUrl.js"></script>
<script>
    $.ajax({
        url:"/news/findNotRead",
        method:"get",
        success:function (res) {
            if(res.code==200){
                for(var i=0;i<res.data.length;i++){
                    $(".newscontext").append(
                        `
						<div class="layui-colla-item "
							<h2 class="layui-colla-title">${res.data[i].ntitle}</h2>
							<h2 class="layui-colla-title">${res.data[i].ndate}:${res.data[i].nwriter}</h2>
							<div class="layui-colla-content layui-show">${res.data[i].ncontent}</div>
						</div>
						<button class=" layui-btn layui-btn-sm  layui-btn-warm"><a href="/news/setRead?id=${res.data[i].id}">已读</a></button>
							`
                    )
                }

            }

        }
    });
    /**/
    /*<a href="/Information/setHadRead?id=${res.data[i].id}">已读</a>*/
    //JS
    layui.use(['element', 'layer', 'util'], function(){
        var element = layui.element
            ,layer = layui.layer
            ,util = layui.util
            ,$ = layui.$;
        //头部事件
        util.event('lay-header-event', {
            //左侧菜单事件
            menuLeft: function(othis){
                layer.msg('展开左侧菜单的操作', {icon: 0});
            }
            ,menuRight: function(){
                layer.open({
                    type: 1
                    ,content: $("#news")
                    ,area: ['260px', '100%']
                    ,offset: 'rt' //右上角
                    ,anim: 5
                    ,shadeClose: true
                });
            }
        });

    });
</script>
</body>
</html>